Magnetic media is used to store data. Continuous perpendicular media is one type of magnetic media that is prevalent. Other types of magnetic media are candidates for extending magnetic recording to 1 Tb/in2 and above. These include Bit patterned media (BPM), thermal assisted recording media (TAR) or its alternative name of Heat assisted magnetic recording (HAMR) and discrete track media (DTM). Magnetic recording can employ synchronization between a write clock and specific disk locations during writing. For BPM, write errors can occur even for perfect synchronization due to statistical variations in the lithography placement and magnetic properties of an island, as well as the presence of gross defects. In the case of BPM media such defects can also be missing islands. One way to mitigate the effect of write errors is to increase the error correction code (ECC) strength, at the expense of loss of areal efficiency due to the associated overhead of disk real estate. For a given fabrication process, the statistical variations tend to scale unfavorably with increasing bit density. As ECC is to handle rare statistical variations in storage media properties, increasing ECC is not always an efficient way to compensate for write errors that occur in the write process. A more efficient storage scheme is achieved when write errors are minimized by optimizing the write process to compensate for the specific local variations in storage media properties.